<?php
include_once './model/password.php';
class LupaPasswordController {
	public function invoke () {
		$password = new Password();
		if (isset($_POST['username']) and isset($_POST['emailuser'])) {
			$pass=$password->resetpassword($_POST['username'],$_POST['emailuser']);
			if ($pass == "harap isi kolom username dan email dengan benar") {
				header("location:./view/lupa_password.php?pass=$pass");
			} else {
				header("location:./view/login.php?pass=$pass");
			}
		}
	}
}